﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.WebControls;
using Lswweb.Model;
using Lswweb.Domain;

namespace Lswweb.Controls
{
    public class GuestBookList : SkinnedGridView<GuestbookInfo>
    {
        public GuestBookList()
        {
            int type=SiteContext.Current.Type;
            if (type != -1)
            {
                this.ItmeType = (GuestBookItem)type;
            }

            this.IsRead = SiteContext.Current.IsTrue;
        }

        protected override IList<GuestbookInfo> GridViewDataSourceHandler(int pageIndex, int pageSize, out int totalRecord)
        {
            return GuestBook.GetGuestBooks(IsRead, ItmeType, pageSize, pageIndex, out totalRecord);
        }

        public GuestBookItem? ItmeType { get; set; }

        public bool? IsRead { get; set; }

        protected override string DefaultSkinFilename
        {
            get { return "GuestBook/GuestBookList.ascx"; }
        }
    }
}
